﻿@using FujiyBlog.Core.DomainObjects
@using FujiyBlog.Core.Extensions

@model WidgetSetting

<div class="widget @(Model.Name.ToLower())" id="widget@(Model.Id)">
    @if (User.IsInRole(Role.ManageWidgets))
    {
        <div class="config-widget-links">
            @Ajax.ActionLink("X", MVC.Widget.Remove(Model.Id), new AjaxOptions { HttpMethod = "POST", OnSuccess = "(function(){$('#widget" + @Model.Id + "').remove();})()" }, new { @class = "delete" })
            @if (ViewEngines.Engines.FindView(ViewContext, Model.Name + "Edit", null).View != null)
            {
                @Ajax.ActionLink(Resources.Labels.Edit, MVC.Widget.Edit(Model.Id), new AjaxOptions { OnSuccess = "fujiyBlog.widget.showEditWidget" }, new { @class = "edit" })
            }
            <a class="move" href="javascript:void(0);" title="Move widget">@Resources.Labels.Move</a>
        </div>
    }
    @RenderBody()
</div>
